1. Field of the Invention
The present invention relates to an apparatus and method for implementing an inverse arctangent function, particularly to an apparatus and method for implementing an inverse arctangent function using piecewise linear theorem to simplify.
2. Description of the Related Art
There are three conventional methods of transformming an inverse arctangent function. The first method is called CORDIC (Coordinate Rotation Digital Computer) coordinate transformation, which uses a multi-stage structure to obtain high accuracy, but the disadvantages of the structure are expensive in hardware costs and long output delay. The above technology is disclosed in xe2x80x9cGEC Plessy, IC Handbook for Digital Video and Digital Signal Processing, Sec. PDSP16330, England, 1995.xe2x80x9d The second method is to use a look-up table, which records every input point and its corresponding output point. The structure of the second method is very simple, but the disadvantage is that a lot of memories are needed. The third method is to use a floating point operation, which uses floating point operations on expansion equations and multi-iteration operations to obtain high accuracy. The disadvantage of the third method is that a lot of hardware costs are needed and it is difficult to complete an inverse arctangent operation using a single instruction. The third method is disclosed in Texas Instrument, xe2x80x9cTMS320c40 User Guide, 1993.xe2x80x9d As mentioned above, the expected performance of an inverse arctangent function, such as high speed, low error and low hardware cost can not be obtained through the prior art technologies.
The object of the present invention is to eliminate the drawbacks of generating more errors and more hardware costs in conventional implementation of an inverse arctangent function. To this end, the present invention provides a method and an apparatus of implementing an inverse arctangent function using the theorem of piecewise linear approach to simplify, which transforms two input right-angled coordinate points X and Y to {circumflex over (xcex8)} which is an approximate value of a phase angle xcex8 of an inverse arctangent function. The present invention uses T-lines combination to approach an inverse arctangent function between 0 degree to 45 degree. Which line segment the input right-angled coordinate points is located in is determined, and the approximate value {circumflex over (xcex8)} is determined by a predefined coefficient table stored in a memory. The phase angles {circumflex over (xcex8)} between 45 degree to 360 degree can be obtained through the linear combination transformation of the phase angles xcex8 between 0 degree to 45 degree.
The apparatus of the present invention mainly comprises: a processing unit which employs the equation       θ    ^    =            Ω      ⁢              (        s        )              +                  Φ        ⁢                  (          s          )                    ·              (                              c            ⁢                          (              k              )                                +                                    d              ⁢                              (                k                )                                      ·                                          y                m                                            x                m                                                    )            
to transfer a right-angled coordinate point X and Y to an approximate value {circumflex over (xcex8)} of a phase angle xcex8 of an inverse arctangent function; and a memory unit connected to said processing unit for storing the value of c(k) and d(k). The method of the present invention mainly comprises: approaching an inverse arctangent function between 0 degree to 45 degree by using T-line combination, and establishing and storing in advance a table containing a plurality of parameters c(k) and d(k); determining which piece said right-angled coordinate point is located at, and capturing the corresponding value of c(k) and d(k) stored in said table; and generating {circumflex over (xcex8)} which is an approximate value of the phase angle xcex8 based on the equation of       θ    ^    =            Ω      ⁢              (        s        )              +                  Φ        ⁢                  (          s          )                    ·                        (                                    c              ⁢                              (                k                )                                      +                                          d                ⁢                                  (                  k                  )                                            ·                                                y                  m                                                  x                  m                                                              )                .            
The present invention can also be implemented by software, because of simplicity of the structure and less operations. The implementation by software also has the advantage as above-mentioned.